ORG 0000H
AJMP MAIN
ORG 000BH
AJMP TIMER0
ORG 0030H
MAIN:MOV SP,#5FH
     MOV R2,#00H
     MOV R3,#00H
     MOV TMOD,#01H
     MOV TH0,#0F8H
     MOV TL0,#30H
     SETB ET0
     SETB EA
     SETB TR0
LOP: AJMP LOP
TIMER0:
     MOV TH0,#0F8H
     MOV TL0,#30H
     INC R2     
     CJNE R2,#1,AB1
     MOV P2,#01H
     AJMP PAN_DUAN
AB1: CJNE R2,#2,BC1
     MOV P2,#03H
     AJMP PAN_DUAN
BC1: CJNE R2,#3,CD1
     MOV P2,#07H
     AJMP PAN_DUAN
CD1: MOV R2,#00H
     MOV P2,#05H
PAN_DUAN:
     INC R3
     CJNE R3,#200,NEXT
     CLR TR0
NEXT:RETI                  
